<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<table border="1" width="1200" style="border-collapse: collapse;text-align: center" >
    <tr>
        <th>序号</th>
        <th>名称</th>
        <th>市场价格</th>
        <th>零售价格</th>
        <th>出产日期</th>
        <th>详细描述</th>
    </tr>
    <c:forEach items="${pp.list}" var="pro" varStatus="sta">
        <tr>
            <td>${sta.count}</td>
            <td>${pro.pname}</td>
            <td>${pro.market_price}</td>
            <td>${pro.shop_price}</td>
            <td width="16%">
                <fmt:formatDate value="${pro.pdate}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate>
            </td>
            <c:if test="${fn:length(pro.pdesc)>25}">
                <td title="${pro.pdesc}">
                        ${fn:substring(pro.pdesc,0 ,25)}...
                </td>
            </c:if>
            <c:if test="${fn:length(pro.pdesc)<=25}">
                <td>
                        ${pro.pdesc}
                </td>
            </c:if>
        </tr>

    </c:forEach>
    <tr>
        <td colspan="6">
            <a href="${pageContext.request.contextPath}/productServlet?method=findPageProduct&pageNumber=${pp.prePage}">上一页</a>
            <c:forEach begin="${pp.begin}" end="${pp.end}" var="i">
                <a href="${pageContext.request.contextPath}/productServlet?method=findPageProduct&pageNumber=${i}">${i}</a>
            </c:forEach>
            <a href="${pageContext.request.contextPath}/productServlet?method=findPageProduct&pageNumber=${pp.nextPage}">下一页</a>
        </td>
    </tr>

</table>

</body>
</html>
